package it.gius.pe.mains;

public class ThreadTest extends Thread{

	/**
	 * @param args
	 */
	private static Object mutex = new Object();
	
	private int count;
	
	public static void main(String[] args) {
		ThreadTest thread = new ThreadTest();
		
		thread.start();

	}
	
	
	public void run(){
		test();
	}
	
	
	public void test(){
		synchronized (mutex) {
			System.out.println("test");
			if(count==0)
			{
				count++;
				test();
				
			}
		}
		
	}

}
